import request from "../utils/request";


export function getProducts(params={}){
    return request({
        method:'GET',
        url:'/products',
        params
    })
}

export function getOne(id){
    return request({
        method:'GET',
        url:`/products/${id}`
    })
}

export function update(data){
    return request({
        method:'PUT',
        url:`/products`,
        data
    })
}

export function deleteProduct(id){
    return request({
        method:'DELETE',
        url:`/products/${id}`
    })
}

export function addProduct(data){
    return request({
        method:'POST',
        url:'/products',
        data
        //data为请求体
    })
}


export function LikesProduct(params){
    return request({
        method:'GET',
        url:'/products/getLikes',
        params
        //此为接口中需要的内容
    })
}
// export function huixian(){
//     return request({
//         method:''
//     })
// }